<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>栏目编辑页面</title>
    <%@ include file="../../common/meta.jsp" %>
    <%@ include file="../../common/common-body.jsp" %>
    <link href="${ctx}/css/plugins/note/note.css?t=${now}" rel="stylesheet">
    <link href="${ctx}/css/page/common-win.css?t=${now}" rel="stylesheet">
    <script src="${ctx}/js/plugins/note/note.js?t=${now}"></script>
    <script src="${ctx}/js/plugins/validate/jquery.validate.custom.js?t=20181024"></script>
</head>
<style>
    #_btnDiv{
        height: 34px;
        margin-bottom: 0px;
    }
    #_parentCodeDiv, #_sicknessDiv {
    <c:if test="${not empty oneColumnInfo && oneColumnInfo.grade == 2}">
        display: block;
    </c:if>
    <c:if test="${not empty oneColumnInfo && oneColumnInfo.grade != 2}">
        display: none;
    </c:if>
    }
    .none-border{
        border: none!important;
        padding-top: 0px;
    }
    .my-modal-body{
        padding: 0px 20px 10px 20px;!important;
    }
</style>
<script>
    var editType = '${editType}';
    var searchStr = '${searchStr}';
    var oneColumnInfo = ${oneColumnInfo};
    var searchInfo = ${searchInfo};
</script>
<body class="gray-bg">
<div id="vue">
    <div class="myContent">
        <div class="tabs-container">
            <div class="tab-content">
                <div id="tab-1" class="tab-pane active">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="ibox float-e-margins myIbox">
                                <div class="ibox-content">
                                    <form class="form-horizontal m-t" id="_columnDataForm">
                                        <div class="form-group form-group-new">
                                            <label class="col-sm-2 control-label"><span style="color: red">*</span>栏目名称：</label>
                                            <div class="col-sm-8">
                                                <input type="text" id="columnName" name="columnName" class="form-control" maxlength="6" placeholder="6个字符以内" required value="${not empty oneColumnInfo ? oneColumnInfo.columnName : ''}">
                                                <span class="help-block m-b-none tip"></span>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-new">
                                            <label class="col-sm-2 control-label"><span style="color: red">*</span>排序：</label>
                                            <div class="col-sm-8">
                                                <input type="text" id="sortNum" name="sortNum" class="form-control" maxlength="9" dights="true" required value="${not empty oneColumnInfo ? oneColumnInfo.sortNum : ''}" isPInteger="true">
                                                <span class="help-block m-b-none tip"></span>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-new">
                                            <label class="col-sm-2 control-label"><span style="color: red">*</span>层级：</label>
                                            <div class="col-sm-8">
                                                <select class="form-control" name="grade" id="grade" onchange="doChangeGrade()" required>
                                                    <option value="1" ${not empty oneColumnInfo && oneColumnInfo.grade == 1 ? 'selected' : '' } >一级栏目</option>
                                                    <option value="2" ${not empty oneColumnInfo && oneColumnInfo.grade == 2 ? 'selected' : '' } >二级栏目</option>
                                                </select>
                                                <span class="help-block m-b-none tip"></span>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-new" id="_parentCodeDiv">
                                            <label class="col-sm-2 control-label"><span style="color: red">*</span>所属父级：</label>
                                            <div class="col-sm-8">
                                                <select class="form-control" name="parentCode" id="parentCode" required>
                                                    <option value="">--请选择--</option>
                                                    <c:forEach items="${parentColumnMap}" var="item">
                                                        <option value="${item.code}" ${not empty oneColumnInfo && oneColumnInfo.parentCode == item.code? 'selected' : '' }>${item.name}</option>
                                                    </c:forEach>
                                                </select>
                                                <span class="help-block m-b-none tip"></span>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-new" id="_sicknessDiv">
                                            <div class="col-sm-2 control-label">
                                                <span style="color: red">*</span>添加疾病：
                                                <br>
                                                <input type="button" class="btn btn-info" onclick="openAddSickPage()" value="添加疾病">
                                                <input type="button" class="btn btn-info" onclick="clearSick()" value="移除全部">
                                            </div>
                                            <div class="col-sm-8">
                                                <div class="note" name="_columnSickTags" readonly="true">
                                                    <c:if test="${not empty oneColumnInfo}">
                                                        <c:forEach items="${oneColumnInfo.columnSickList}" varStatus="i" var="item" >
                                                            <div class="note_lable" name="_columnSickTags" value="${item.sicknessCode}">
                                                                <lable>${item.sicknessName}</lable>
                                                                <div  onclick="$(this).parent().remove()">X</div>
                                                                <div  class="note_mind"></div>
                                                            </div>
                                                        </c:forEach>
                                                    </c:if>
                                                </div>
                                                <span class="help-block m-b-none tip"></span>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-new">
                                            <div class="col-sm-2 control-label">
                                                <span style="color: red">*</span>添加科室：
                                                <br>
                                                <input type="button" class="btn btn-info" onclick="openAddColumnDeptPage()" value="添加科室">
                                                <input type="button" class="btn btn-info" onclick="clearColumnDept()" value="移除全部">
                                            </div>
                                            <div class="col-sm-8">
                                                <div class="note" name="_columnDeptTags" readonly="true">
                                                    <c:if test="${not empty oneColumnInfo}">
                                                        <c:forEach items="${oneColumnInfo.columnDeptList}" varStatus="i" var="item" >
                                                            <div class="note_lable" name="_columnDeptTags" value="${item.deptCode}">
                                                                <lable>${item.deptName}</lable>
                                                                <div  onclick="$(this).parent().remove()">X</div>
                                                                <div  class="note_mind"></div>
                                                            </div>
                                                        </c:forEach>
                                                    </c:if>
                                                </div>
                                                <span class="help-block m-b-none tip"></span>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-new">
                                            <label class="col-sm-2 control-label">备注：</label>
                                            <div class="col-sm-8">
                                                <textarea type="text" id="remark" name="remark" class="form-control" maxlength="500" style="height: 80px; resize: none;">${not empty oneColumnInfo ? oneColumnInfo.remark : ''}</textarea>
                                                <span class="help-block m-b-none tip"></span>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="ibox float-e-margins">
            <div class="ibox-content">
                <div class="form-group" id="_btnDiv">
                    <div class="col-sm-4 col-sm-offset-5">
                        <c:if test="${type != 'info'}">
                            <input type="button" class="btn btn-info" onclick="doSave()" value="保存">
                        </c:if>
                        <input type="button" class="btn btn-white" onclick="doCheckDataChange()" value="返回">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<%--<div id="addColumnDeptPage" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header text-center">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4>添加科室</h4>
            </div>
            <div class="modal-body modal-body-height my-modal-body">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins" style="margin-bottom: 0px;">
                            <div class="ibox-content ibox-content-search none-border" style="padding-bottom: 0px;">
                                <form class="form-horizontal m-t" novalidate="novalidate">
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label control-model">科室名称：</label>
                                        <div class="col-sm-10">
                                            <div class="input-group" style="width: 460px!important;">
                                                <input type="text" name="columnDeptName" id="columnDeptName" class="form-control" onkeydown="if(event.keyCode==13){queryColumnDept();return false;}"
                                                       maxlength="30">
                                                <span class="input-group-btn"> <button type="button" class="btn btn-primary" onclick="queryColumnDept()">查询</button></span>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th style="width: 145px;">一级科室</th>
                            <th>二级科室</th>
                        </tr>
                        </thead>
                        <tbody id="columnDeptData">
                        <c:forEach items="${columnDeptMap}" var="item">
                            <tr>
                                <td>
                                    <label idd="${item.name}" style="width: 140px;float: left;">
                                        <input type="checkbox" name="columnDept" idd="oneDept" value="${item.code}"/>${item.name}&nbsp;&nbsp;
                                    </label>
                                </td>
                                <td id="depts">
                                    <c:forEach items="${item.depts}" var="dept">
                                        <label idd="${dept.deptName}" style="width: 140px;float: left;">
                                            <input type="checkbox" name="columnDept" idd="${item.code}" value="${dept.deptCode}"/>${dept.deptName}&nbsp;&nbsp;
                                        </label>
                                    </c:forEach>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-info" onclick="doAddColumnDept()">保存</button>
                <button class="btn btn-white" onclick="$('#addColumnDeptPage').modal('hide')">取消</button>
            </div>
        </div>
    </div>
</div>--%>

<div id="addSickPage" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header text-center">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4>添加疾病</h4>
            </div>
            <div class="modal-body modal-body-height">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins" style="margin-bottom: 0px;">
                            <div class="ibox-content ibox-content-search none-border" style="padding-bottom: 0px;">
                                <form class="form-horizontal m-t" id="_searchForm" novalidate="novalidate">
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">一级科室：</label>
                                        <div class="col-sm-4">
                                            <select class="form-control" name="pDeptCode" id="pDeptCode" onchange="doPDeptChangeEvent()">
                                                <option value="">--请选择--</option>
                                                <c:forEach items="${deptMap}" var="item">
                                                    <option value="${item.code}">${item.name}</option>
                                                </c:forEach>
                                            </select>
                                        </div>
                                        <label class="col-sm-2 control-label">二级科室：</label>
                                        <div class="col-sm-4">
                                            <select class="form-control" name="cDeptCode" id="cDeptCode" onchange="doSickSearch()">
                                                <option value="">--请选择--</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label control-model">疾病名称：</label>
                                        <div class="col-sm-10">
                                            <div class="input-group" style="width: 460px!important;">
                                                <input type="text" name="sickName"   id="sickName" class="form-control" onkeydown="if(event.keyCode==13){doSickSearch();return false;}"
                                                       maxlength="30">
                                                <span class="input-group-btn"> <button type="button" class="btn btn-primary" onclick="doSickSearch()">查询</button></span>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content none-border">
                                <table class='table table-striped table-hover'
                                       id="sickTable"
                                       data-toggle="table"
                                       data-pagination="true"
                                       data-side-pagination="server"
                                       data-striped="true"
                                       data-response-handler="handleServerResult"
                                       data-query-params-type=""
                                       data-query-params="getDeptParams"
                                       data-page-size="${defaultPageSize}"
                                       data-page-list="${pageList}">
                                    <thead>
                                    <tr>
                                        <th data-field="checkBx" data-checkbox="true"></th>
                                        <th data-field="sicknessCode" data-visible="false">sicknessCode</th>
                                        <th data-field="sicknessName" data-align="center">疾病</th>
                                    </tr>
                                    </thead>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-info" onclick="doAddSick()">保存</button>
                <button class="btn btn-white" onclick="$('#addSickPage').modal('hide')">取消</button>
            </div>
        </div>
    </div>
</div>

<div id="addColumnDeptPage" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header text-center">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4>添加科室</h4>
            </div>
            <div class="modal-body modal-body-height">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins" style="margin-bottom: 0px;">
                            <div class="ibox-content ibox-content-search none-border" style="padding-bottom: 0px;">
                                <form class="form-horizontal m-t" id="_searchForm1" novalidate="novalidate">
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">一级科室：</label>
                                        <div class="col-sm-10">
                                            <select class="form-control" name="_pDeptCode" id="_pDeptCode" onchange="doColumnDeptSearch()">
                                                <option value="">--请选择--</option>
                                                <c:forEach items="${deptMap}" var="item">
                                                    <option value="${item.code}">${item.name}</option>
                                                </c:forEach>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label control-model">科室名称：</label>
                                        <div class="col-sm-10">
                                            <div class="input-group" style="width: 460px!important;">
                                                <input type="text" name="deptName"   id="deptName" class="form-control" onkeydown="if(event.keyCode==13){doColumnDeptSearch();return false;}"
                                                       maxlength="30">
                                                <span class="input-group-btn"> <button type="button" class="btn btn-primary" onclick="doColumnDeptSearch()">查询</button></span>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content none-border">
                                <table class='table table-striped table-hover'
                                       id="deptTable"
                                       data-toggle="table"
                                       data-pagination="true"
                                       data-side-pagination="server"
                                       data-striped="true"
                                       data-response-handler="handleServerResult"
                                       data-query-params-type=""
                                       data-query-params="getDeptInfoParams"
                                       data-page-size="${defaultPageSize}"
                                       data-page-list="${pageList}">
                                    <thead>
                                    <tr>
                                        <th data-field="checkBx" data-checkbox="true"></th>
                                        <th data-field="deptCode" data-visible="false">code</th>
                                        <th data-field="deptName" data-align="center">二级科室</th>
                                    </tr>
                                    </thead>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-info" onclick="doAddColumnDept()">保存</button>
                <button class="btn btn-white" onclick="$('#addColumnDeptPage').modal('hide')">取消</button>
            </div>
        </div>
    </div>
</div>

<script src="${ctx}/js/output/win/editColumnMgr.js?time=${now}"></script>
</body>
</html>

